package com.shelpe.services.sinbadgateway.client;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

@FeignClient(name="${feign.auth.name}", url="${feign.auth.url}")
public interface AuthClient {

	@RequestMapping(path="/oauth/check_token", method=RequestMethod.GET, consumes="application/json;charset=UTF-8")
	TokenInfo checkToken(String token);
	
	@Data
	public static class TokenInfo{
		@JsonProperty("client_id")
		private String clientID;
		
		@JsonProperty("tenant_name")
		private String nick;
	}
}
